import http from '../utils/http_interceptor.js';
import { getCacheData } from '@/utils/util.js';

/**
 * 批量获取多个数据字典值
 * @params {String} codes 数据字典类型值，多个以英文逗号隔开
 */ 
export const getListByCode = async (params = {}, expirationxt = 60 * 8) => {
	const requestUrl = '/spool/v1/type/getListByCode'
	return await getCacheData(requestUrl, params, async () => {
		return await http.post(requestUrl, params);
	}, expirationxt)
};

/**
 * 数据字典值：服务类别  批量接口无法查询服务类别数据
 * @params {String} codes：9
 */ 
export const getTagByCode = async (params = { codes: '9' }, expirationxt = 60 * 8) => {
	const requestUrl = '/spool/v1/tag/getTagByCode'
	return await getCacheData(requestUrl, params, async () => {
		return await http.post(requestUrl, params);
	}, expirationxt)
};
